<%@ page import="com.workmanager.bean.StudentBean" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2016/8/27
  Time: 21:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@include file="../inc/top.jsp"%>
<%
    StudentBean astudent=(StudentBean) request.getSession().getAttribute("STUDENT");
    List<String> classnames=(List<String>) request.getSession().getAttribute("classnames");
    String classname=(String)request.getSession().getAttribute("classname");
    System.out.println("-------------"+astudent.getStudent_interest()+"+++++"+astudent.getStudent_signature());
    //TODO:如果当有红* 的地方没有填的话，在页面给出提示
    //TODO:刚调到页面，select显示从数据库中获得的信息
%>
<%----%>
<link href="<%=ctxpath%>/static/student/css/studentlogin.css" rel="stylesheet"/>
<link href="<%=ctxpath%>/static/student/css/studentMessagechange.css" rel="stylesheet"/>
<script src="<%=ctxpath%>/static/student/js/studentMessage.js"></script>
<form class="messagechangeform" >
    <div class="col-xs-12">
            <table class="table table-bordered">
                <thead><h3>学生信息修改页面</h3></thead>
               <tr>                                                  <%--value="<%=astudent.getStudent_sex()%>--%>
                    <th class="title">姓名(<em class="shezhi">*</em> )</th>
                    <td ><input type="text" id="xingming" name="xingming" value="<%=astudent.getStudent_name()%>"/></td>
                    <th class="title">性别</th>
                    <td>
                        <select width="100px" id="sex" name="sex">
                            <%
                                if(astudent.getStudent_sex()!=null&&astudent.getStudent_sex().equals("男")){
                            %>
                            <option selected>男</option>
                            <option>女</option>
                            <%
                                }else{
                            %>
                            <option selected>女</option>
                            <option>男</option>
                            <%
                                }
                            %>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th class="title">学号(<em class="shezhi">*</em> )</th>
                    <td><input type="text"  id="xuehao" name="xuehao" value="<%=astudent.getStudent_number()%>"/> </td>
                    <th class="title">班级(<em class="shezhi">*</em> )</th><!-- 可以在controller里存入到session里面，通过reques得到班级的名称-->
                    <td>
                        <%--实现当班级为空的时候，学生可以选择班级，当不为空的时候，班级为制度--%>
                        <select id="banji" name="banji">
                            <%
                                if(classname!=""){
                            %>
                            <option><%=classname%></option>
                            <%
                            System.out.println("--------------ceshi");
                            }else{
                            %>
                            <%
                                for(String class_name:classnames){

                            %>
                            <option><%=class_name%></option>
                            <%}
                            }
                            %>
                            </select>
                    </td>
                </tr>
                <tr>
                    <th class="title">专业</th>
                    <td><input type="text"  id="major" name="major" value="<%=(astudent.getStudent_major()==null?"":astudent.getStudent_major())%>"/></td>
                    <th class="title">联系方式(<em class="shezhi">*</em> )</th>
                    <td><input type="text" id="phonenumber" name="phonenumber" value="<%=(astudent.getStudent_phone()==null?"":astudent.getStudent_phone())%>" readonly/></td>
                </tr>
                <tr>
                    <th class="title">学校</th>
                    <td><input type="text"  id="school" name="school" value="<%=(astudent.getStudent_school()==null?"":astudent.getStudent_school())%>"/> </td>
                    <th class="title">出生年月日</th>
                    <td><input type="date" id="birthday" name="birthday" value="<%=(astudent.getStudent_brithday()==null?"":astudent.getStudent_brithday())%>"></td>
                </tr>
                <tr>
                    <th class="title">QQ号</th>
                    <td><input type="text" id="qqnumber" name="qqnumber" value="<%=(astudent.getStudent_qq()==null?"":astudent.getStudent_qq())%>"/></td>
                    <th class="title">微信号</th>
                    <td ><input type="text"id="weixin" name="weixin" value="<%=(astudent.getStudent_wechat()==null?"":astudent.getStudent_wechat())%>"/></td>
                </tr>
                <tr>
                    <th class="title">家庭住址</th>
                    <td colspan="3"><input type="text" id="address" name="address" value="<%=(astudent.getStudent_address()==null?"":astudent.getStudent_address())%>"/></td>
                </tr>
                <tr>
                    <th class="title">兴趣爱好</th>
                    <td colspan="3"><textarea rows="3" type="text" id="interexts" name="interexts" ><%=(astudent.getStudent_interest()==null?"":astudent.getStudent_interest())%></textarea></td>
                </tr>
                <tr>
                    <th class="title">个性签名</th>
                    <td colspan="3"><textarea rows="3" type="text" id="qianming" name="qianming" ><%=(astudent.getStudent_signature()==null?"":astudent.getStudent_signature())%></textarea></td>
                </tr>
                <tr>
                    <td colspan="4" style="text-align:center">
                        <button class="btn btn-primary" type="button" id="save">保存</button>&nbsp;&nbsp;&nbsp;&nbsp;
                        <a class="btn btn-primary" type="button" href="<%=ctxpath%>/information/stuinfo.wm">取消</a>
                    </td>
                </tr>
                <tfoot><em class="shezhi">*信息为必填信息</em></tfoot>
            </table>
    </div>
</form>
<%@include file="../inc/bottom.jsp"%>